<?php
$aNamespace = new Zend_Session_Namespace(Constant::USER_DATA);
?>

<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>
<div id="searchKeywords"><?php 

$keywords = $this->searchKeywords(SessionUtil::getProperty(Constant::SEARCH_DATA));

echo $keywords;
?></div>

<div style="width:910px;float:left;clear:both;">
<div class="dashline"></div>
<ul class="items">
<?php
foreach ($this->paginator as $advertisement) {
	?>

	<li>
	<?php if($advertisement->status == "closed"){?>
		<div class="closedMark"></div>
	<?php }?>
		<div class="itemTime"><?php echo $this->PostDate($advertisement->created);?></div>
		<div class="itemType">
		<div class="<?php if($advertisement->type == "lease") echo "itemKeTuo"; else echo "itemQiuTuo";?>"></div>
		</div>		
		<a class="itemLink" href="<?php echo $this->url(array('controller'=>'bulletin', 'action'=>'view', 'id'=>$advertisement->advertismentId), "view", true);?>">
		<div class="itemTitle">
			<h3 class="fromCity">
			<?php echo Advertisement::getFromCity($advertisement->advertismentId)->name_cn;?> </h3>
			<div class=fromTime><?php if($advertisement->type == "lease"){  
			echo $advertisement->departure_time;}  ?></div>
			<div class="weight"><?php echo $advertisement->weight?></div>
			<div class="fly"></div>
			<h3 class="toCity">
			<?php echo Advertisement::getToCity($advertisement->advertismentId)->name_cn; ?>
			</h3>
			<div class=toTime><?php 
			if($advertisement->type == "lease"){  
			echo $advertisement->arrival_time;} 
			else {echo "<strong>最迟 </strong> ".$advertisement->arrival_time;}?></div>
		</div></a>
		
		<?php if ($this->userIsTrusted($advertisement->user_id)){?><a class="verifiedIcon" href="<?php echo $this->url(array('controller'=>'index','action'=>'about'), "about", true);?>#verifiedSection"></a><?php }?>
		
		<a href="<?php echo $this->url(array("controller"=>"user", "action"=>"view", "id"=>$advertisement->user_id), "default", true)?>">
		<?php 
		echo empty($advertisement->small_image) ? $advertisement->username : "<img src=\"".$advertisement->small_image."\" border=\"0\"/>"; 
		?>
		</a>
		
	</li>
	<div class="dotline"></div>
	<?php
	}
?>
</ul>
<div class="dashline"></div>
</div>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>
